<template>
    <view class="contentbox" :style="'margin-bottom:'+marbo+'rpx;'" @click.stop="gotode(item)">
        <view class="actInfo actBGBox">
            <view class="actIContent" @click="goDetailUrl(item)">
                <view class="aicImg">
                    <image class="logoimg" :src="getimageFirst(item.Images)" mode="aspectFill"></image>
                </view>
                <view class="aicCenter">
                    <view class="aicTitle">{{ $util.entitiesToUtf16(item.Title) }}</view>
                    <view class="aicText">
                        <view class="hiddenText">{{ `时间：${getTime2(item.ServerDate)}
                            ${getWeek(item.ServerDate)}${item.ServerTime}` }}</view>
                        <view class="addressBox">
                            <view class="aicAddress hiddenText">{{ '地址：' + item.Place }}</view>
                            <view class="seemap" v-if="showMap" @click.stop="openMap(item)">查看地图</view>
                        </view>
                    </view>
                </view>
            </view>
            <view class="actIPiceBox">
                <view class="aipTitle">总价：</view>
                <view class="aipNum">{{ item.RegisterFee == 0 ? (item.FeeRule == '免费'?'免费':'柜台结算') : ('￥' + item.RegisterFee) }}</view>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    props: {
        item: {
            default: {},
            typeof: Object
        },
        marbo:{
            default:0,
            typeof:Number
        },
        showMap:{
            default:false,
            typeof:Boolean
        },
        goNext:{            //跳转页面 0:不跳转  1:跳订单详情页  2:跳活动详情页
            default:0,
            typeof:Number
        }
    },
    data() {
        return {

        };
    },
    methods: {
        gotode(item){
            if(this.navtode){
                this.nav_to('/pages/ball/ball_details?id=' + item.ID)
            }else{
                return ''
            }
            
        },
        getimageFirst(Images = '') {
            let imglist = Images.split(',')
            return imglist[0]

        },

        getTime2(l) {
            let d = new Date(l);
            let timestamp = d.getTime();
            return this.$u.date(timestamp, 'mm-dd');
        },
        getWeek(l) {
            let d = new Date(l);
            let week = d.getDay();
            let weekList = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
            return weekList[week];
        },
        openMap(e) {
			uni.openLocation({
				latitude: e.Latitude,
				longitude: e.Longitude,
				success: function () {
					console.log('success');
				}
			});
		},
        // 点击跳转
        goDetailUrl(e){
            if (this.goNext == 0) {
                return
            }
            let url = this.goNext==1?`/pages/together/order_detail?id=${e.ID}`:`/pages/ball/ball_details?id=${e.ID}`
            this.nav_to(url)
        },

    }
}
</script>

<style lang="scss">
view {
    box-sizing: border-box;
}

.contentbox {
    width: 100%;

    .actBGBox {
        background: #FFFFFF;
        border-radius: 16rpx;
        padding: 32rpx;
    }

    .actInfo {
        width: 100%;

        .actIContent {
            width: 100%;
            display: flex;

            .aicImg {
                width: 164rpx;
                height: 216rpx;
                border-radius: 8rpx;
                overflow: hidden;

                .logoimg {
                    width: 100%;
                    height: 100%;
                    display: block;
                }
            }

            .aicCenter {
                width: calc(100% - 164rpx);
                padding-left: 32rpx;
                height: auto;
                display: flex;
                flex-direction: column;
                justify-content: space-between;

                .aicTitle {
                    width: 100%;
                    font-weight: bold;
                    font-size: 28rpx;
                    color: #333333;
                }

                .aicText {
                    width: 100%;

                    >view {
                        margin-top: 4rpx;
                        font-weight: 500;
                        font-size: 24rpx;
                        color: #999999;

                        
                    }
                    .addressBox{
                        width: 100%;
                        display: flex;
                        align-items: center;
                        flex-wrap: nowrap;
                        overflow: hidden;
                        .aicAddress {
                            font-weight: 500;
                            font-size: 24rpx;
                            color: #999999;
                            flex: 1;
                        }

                        .seemap {
                            min-width: 96rpx;
                            font-weight: 500;
                            font-size: 24rpx;
                            color: #706EEE;
                        }
                    }

                }
            }
        }

        .actIPiceBox {
            width: 100%;
            display: flex;
            justify-content: flex-end;
            align-items: baseline;
            margin-top: 32rpx;

            .aipTitle {
                font-weight: 500;
                font-size: 28rpx;
                color: #333333;
            }

            .aipNum {
                font-weight: bold;
                font-size: 36rpx;
                color: #333333;
            }
        }
    }
}
</style>
